package svgedit.japangui.actions;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

import svgedit.japangui.JapanFrame;


/** Shows discard changes dialog, then sets the document to a new,
 *  empty document.
 */
@SuppressWarnings("serial")
public class NewDocumentAction extends AbstractAction {

    private JapanFrame japanFrame;

    /** Create this action for the given frame */
    public NewDocumentAction(JapanFrame japanFrame) {
        super("\u65B0");
        this.japanFrame = japanFrame;
    }

    public void actionPerformed(ActionEvent ae) {
        if (japanFrame.confirmSaveChanges())
        	japanFrame.newFile();
    }


}
